package com.weishaoying.thrift.learn.annotation;

import com.facebook.swift.codec.ThriftEnum;
import com.facebook.swift.codec.ThriftEnumValue;

@ThriftEnum
public enum ThriftAnnotatedEnum {

    FIRST_VALUE("fist"),

    SECOND_VALUE("second");

    private String description;

    ThriftAnnotatedEnum(String description) {
        this.description = description;
    }

    //提供了返回int类型的无参public函数，建立从枚举值到整数的映射
    @ThriftEnumValue
    public int getIntValue() {
        return this.description.hashCode();
    }
}

